<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileOverview 마이스크랩 > 폴더영역 > 폴더 순서 변경시 Drag&Drop을 사용할 수 있도록 이벤트 연동
<span class='line'>  3</span>  * @author qpitlove
<span class='line'>  4</span>  */</span><span class="WHIT">
<span class='line'>  5</span> </span><span class="NAME">nhn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.nhn</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  6</span> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  7</span> </span><span class="NAME">nhn.newsstand.myscrap</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nhn.newsstand.myscrap</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>  8</span> </span><span class="NAME">nhn.newsstand.myscrap.FolderMoveDrag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Class</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>  9</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="WHIT">	</span><span class="COMM">/** @lends nhn.newsstand.myscrap.FolderMoveDrag.prototype */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 12</span> 	 * nhn.newsstand.myscrap.FolderMoveDrag 클래스의 인스턴스를 생성한다.  
<span class='line'> 13</span> 	 * @constructs
<span class='line'> 14</span> 	 * @class 마이스크랩 > 폴더영역 > 폴더 순서 변경시 Drag&Drop을 사용할 수 있도록 이벤트 연동
<span class='line'> 15</span> 	 * @extends jindo.Component
<span class='line'> 16</span> 	 * @requires nhn.newsstand.myscrap.FolderMoveDrag.oHTML
<span class='line'> 17</span> 	 * @requires nhn.newsstand.common.util
<span class='line'> 18</span> 	 * @requires jindo.DragArea
<span class='line'> 19</span> 	 * @requires jindo.DropArea
<span class='line'> 20</span> 	 * @param {nhn.newsstand.myscrap.FolderTree} oFolderTree nhn.newsstand.myscrap.FolderTree 인스턴스 
<span class='line'> 21</span> 	 * @param {nhn.newsstand.myscrap.FolderMove} oFolderMove nhn.newsstand.myscrap.FolderMove 인스턴스
<span class='line'> 22</span> 	 * @example
<span class='line'> 23</span> 	 * var folderTree = new nhn.newsstand.myscrap.FolderTree($$.getSingle(".folder_area ul.folder_lst"));
<span class='line'> 24</span> 	 * var folderMove = new nhn.newsstand.myscrap.FolderMove(folderTree);
<span class='line'> 25</span> 	 * var folderMoveDrag = new nhn.newsstand.myscrap.FolderMoveDrag(folderTree, folderMove);
<span class='line'> 26</span> 	 * 
<span class='line'> 27</span> 	 * folderMoveDrag.attach({
<span class='line'> 28</span> 	 *     dragStart : function(oCustomEvent){}, //jindo.DragArea의 CustomEvent dragStart와 동일
<span class='line'> 29</span> 	 *     dragEnd : function(oCustomEvent){} //jindo.DragArea의 CustomEvent dragEnd와 동일
<span class='line'> 30</span> 	 * });
<span class='line'> 31</span> 	 */</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT">	</span><span class="NAME">$init</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oFolderTree</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oFolderMove</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">		</span><span class="NAME">this.oFolderTree</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oFolderTree</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT">		</span><span class="NAME">this.oFolderMove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oFolderMove</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 35</span> 
<span class='line'> 36</span> </span><span class="WHIT">		</span><span class="NAME">this._initDragAreaComponent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT">		</span><span class="NAME">this._initDropAreaComponent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT">		</span><span class="NAME">this._attachHTMLElementEvent</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 43</span> 	 * Element에 이벤트를 바인딩 한다.
<span class='line'> 44</span> 	 */</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">	</span><span class="NAME">_attachHTMLElementEvent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oLayerBubbler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">oUtil.Bubbler</span><span class="PUNC">(</span><span class="NAME">this.oFolderTree.getLayer</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">		</span><span class="NAME">oLayerBubbler.attach</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">			</span><span class="STRN">"_folder-dragable:mouseenter"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self._oDragArea.isDragging</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">				</span><span class="NAME">self.highlightNode</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">			</span><span class="STRN">"_folder-dragable:mouseleave"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">eEvent</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aArgs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">				</span><span class="NAME">self.highlightNode</span><span class="PUNC">(</span><span class="NAME">elTarget</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 59</span> 	 * 노드를 하이라이트 하는 함수
<span class='line'> 60</span> 	 * @param {HTMLElement} elNode 하이라이트 대상 Element
<span class='line'> 61</span> 	 * @param {Boolean} bHighlight 하이라이트 여부
<span class='line'> 62</span> 	 */</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">	</span><span class="NAME">highlightNode</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">elNode</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bHighlight</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">childNodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.oFolderTree.getAllNodes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT">		</span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">childNodes.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.oFolderTree.getPartsOfNode</span><span class="PUNC">(</span><span class="NAME">childNodes</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">elItem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">			</span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elItem</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">elNode</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">childNodes</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">bHighlight</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"addClass"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"removeClass"</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="STRN">"over"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 72</span> 	 * draArea 콤포넌트 초기화 함수
<span class='line'> 73</span> 	 */</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">	</span><span class="NAME">_initDragAreaComponent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._oDragArea</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">welPhantom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="STRN">"folder-phantom"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">		</span><span class="NAME">this._oDragArea</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jindo.DragArea</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">			</span><span class="NAME">sClassName</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"_folder-dragable"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">			</span><span class="NAME">bFlowOut</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attach</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT">			</span><span class="STRN">"dragStart"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT">				</span><span class="NAME">document.body.style.cursor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"move"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">				</span><span class="COMM">/* 드래그하기위해 선택된 엘리먼트를 저장 */</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">welSelected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getPartsOfNode</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">elItem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">self.oFolderTree.getSelectedNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">					</span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elItem</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"mv_type3"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"mv_type2"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">					</span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elItem</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"mv_type3"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">addClass</span><span class="PUNC">(</span><span class="STRN">"mv_type2"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">				</span><span class="NAME">welPhantom.empty</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">html</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">					</span><span class="NAME">$Template</span><span class="PUNC">(</span><span class="NAME">nhn.newsstand.myscrap.FolderMoveDrag.oHTML.DRAGGING_FOLDER</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">process</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">						</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">							</span><span class="NAME">folderNm</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeLabelHtml</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrag</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">							</span><span class="NAME">hasChild</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.hasChild</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrag</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT">							</span><span class="NAME">level</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeDepth</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrag</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">						</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">				</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">				</span><span class="COMM">/* 임시 엘리먼트의 최초 위치 설정 */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">htPos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">welSelected.offset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">				</span><span class="NAME">welPhantom.offset</span><span class="PUNC">(</span><span class="NAME">htPos.top</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">htPos.left</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT">				</span><span class="COMM">/* 임시 엘리먼트가 실제로 이동되도록 설정 */</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT">				</span><span class="NAME">oCustomEvent.elDrag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">welPhantom.$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">				</span><span class="NAME">self.fireEvent</span><span class="PUNC">(</span><span class="STRN">"dragStart"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">			</span><span class="NAME">beforeDrag</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">				</span><span class="COMM">/* 드래그시 좌표를 마우스 포인트에 현재 뷰의 좌표에 고정 */</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oMousePos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oCustomEvent.weEvent.pos</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">				</span><span class="NAME">oCustomEvent.nX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oMousePos.pageX</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">15</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">				</span><span class="NAME">oCustomEvent.nY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oMousePos.pageY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">15</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">			</span><span class="NAME">dragEnd</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">				</span><span class="NAME">document.body.style.cursor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"default"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">				</span><span class="NAME">welPhantom.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getPartsOfNode</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">elItem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT">				</span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elItem</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"mv_type3"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeClass</span><span class="PUNC">(</span><span class="STRN">"mv_type2"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">				</span><span class="NAME">self.fireEvent</span><span class="PUNC">(</span><span class="STRN">"dragEnd"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>131</span> 	 * dropArea 초기화 함수
<span class='line'>132</span> 	 */</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">	</span><span class="NAME">_initDropAreaComponent</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this._oDropArea</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">welTreeLine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="STRN">'&lt;li class="tree_line tree-node">&lt;div>&lt;/div>&lt;/li>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">		</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">		</span><span class="NAME">this._oDropArea</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jindo.DropArea</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">				</span><span class="NAME">sClassName</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> 	</span><span class="STRN">"_folder-dropable"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">				</span><span class="NAME">oDragInstance</span><span class="PUNC">:</span><span class="WHIT">	</span><span class="NAME">this._oDragArea</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attach</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">	        </span><span class="NAME">over</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dropDepth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeDepth</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrop</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeDepth</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">				</span><span class="COMM">//1차 폴더는 2차 폴더로 이동할 수 없으므로 1차 폴더의 하단으로 이동할 수 있게 가이드 라인선을 표시한다.</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elHandleParent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getParentNode</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elDropTarget</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dropDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getParentNode</span><span class="PUNC">(</span><span class="NAME">oCustomEvent.elDrop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">oCustomEvent.elDrop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">				</span><span class="COMM">//드래그중인 2차 폴더가 자신의 1차 폴더를 가리킨다면 하위 컨테이너 UL의 맨 처음 하위로 삽입선을 넣어준다.</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">dropDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">elHandleParent</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">elDropTarget</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">					</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elChildNodeContainer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getChildNodeContainer</span><span class="PUNC">(</span><span class="NAME">elDropTarget</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">					</span><span class="NAME">welTreeLine.prependTo</span><span class="PUNC">(</span><span class="NAME">elChildNodeContainer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="KEYW">else</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">					</span><span class="NAME">$Element</span><span class="PUNC">(</span><span class="NAME">elDropTarget</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">after</span><span class="PUNC">(</span><span class="NAME">welTreeLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">	        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">	        </span><span class="NAME">out</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">	        	</span><span class="COMM">//마우스 아웃이 발생되었을 때 오버된 엘리먼트가 없을 경우 트리라인을 제거함</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">	        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">this.getOveredLists</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT">	        		</span><span class="NAME">welTreeLine.leave</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">	        	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT">	        </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">	        </span><span class="NAME">drop</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oCustomEvent</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT">	        	</span><span class="COMM">//Drop 할 위치를 결정하는 삽입선이 현재 트리내에 존재하지 않으면 Drop Action 취소함</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">	        	</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">self.oFolderTree.getNode</span><span class="PUNC">(</span><span class="NAME">welTreeLine.$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">	        	</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">	        	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elHandle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oCustomEvent.elHandle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">elDrop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oCustomEvent.elDrop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">	        	</span><span class="COMM">//DragNDrop으로 이동하려는 위치가 현재 위치이면 리턴</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">elHandle</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">elDrop</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">					</span><span class="NAME">welTreeLine.leave</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeDepth</span><span class="PUNC">(</span><span class="NAME">elHandle</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elTreeLine</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">welTreeLine.$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lineDepth</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeDepth</span><span class="PUNC">(</span><span class="NAME">elTreeLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elLineParent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getParentNode</span><span class="PUNC">(</span><span class="NAME">elTreeLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> 
<span class='line'>183</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">folderSeq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getFolderSeqByNode</span><span class="PUNC">(</span><span class="NAME">elHandle</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentFolderSeq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">					</span><span class="COMM">//이동하려는 폴더가 2차 폴더일때 삽입위치 라인이 1차 폴더일때와 2차 폴더일때를 구분해서 처리한다.</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">					</span><span class="NAME">parentFolderSeq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">lineDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">							</span><span class="NAME">self.oFolderTree.getFolderSeqByNode</span><span class="PUNC">(</span><span class="NAME">welTreeLine.prev</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">$value</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">							</span><span class="NAME">self.oFolderTree.getFolderSeqByNode</span><span class="PUNC">(</span><span class="NAME">elLineParent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">exceptHandleFilter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">					</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">elHandle</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT">					</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT">				</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>196</span> 
<span class='line'>197</span> </span><span class="WHIT">				</span><span class="COMM">//1차끼리, 2차끼리 이동 시 자신을 제외한 후 이동할 위치 Index를 재계산 해야 한다.</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waDropableChildNodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$A</span><span class="PUNC">(</span><span class="NAME">self.oFolderMove.getMoveableChildNodes</span><span class="PUNC">(</span><span class="NAME">elLineParent</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">filter</span><span class="PUNC">(</span><span class="NAME">exceptHandleFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">				</span><span class="COMM">//2차 폴더를 같은 1차 부모 폴더내에서 이동 시 자신을 제외한 후 이동할 위치 Index를 재계산 해야 한다. </span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aTargetChildNodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getChildNodes</span><span class="PUNC">(</span><span class="NAME">self.oFolderTree.getNodeByFolderSeq</span><span class="PUNC">(</span><span class="NAME">parentFolderSeq</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waTargetChildNodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$A</span><span class="PUNC">(</span><span class="NAME">aTargetChildNodes</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">filter</span><span class="PUNC">(</span><span class="NAME">exceptHandleFilter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">			</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">orderIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">lineDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">			 			</span><span class="COMM">//2차 폴더를 1차 폴더의 하위로 이동 시 마지막 노드로 이동하도록 한다.</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">						</span><span class="NAME">waTargetChildNodes.length</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT">						</span><span class="COMM">//폴더를 이동 시 Drop되는 위치의 엘리먼트가 내 폴더이면 인덱스가 0, 아니면 삽입 노드의 위치로 폴더를 이동하도록 한다.</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT">						</span><span class="NAME">waDropableChildNodes.indexOf</span><span class="PUNC">(</span><span class="NAME">elTreeLine</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">	</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT">				</span><span class="COMM">//폴더삽입 가이드선 제거</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT">				</span><span class="NAME">welTreeLine.leave</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">				</span><span class="COMM">//console.log(handleDepth, lineDepth, folderSeq, orderIndex+1, parentFolderSeq);</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">				</span><span class="COMM">//내폴더의 하위로 하위폴더가 이동할 수 없으므로 예외조건 추가</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">				</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elParentNode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getNodeByFolderSeq</span><span class="PUNC">(</span><span class="NAME">parentFolderSeq</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">				</span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">handleDepth</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">elParentNode</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">self.oFolderTree.getMyFolderNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">				</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">				</span><span class="COMM">//UI 인덱스가 0부터 시작되므로 request Param은 1부터 시작해야 함.</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT">				</span><span class="NAME">self.oFolderMove.requestFolderMove</span><span class="PUNC">(</span><span class="NAME">folderSeq</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">orderIndex</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parentFolderSeq</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT">	        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>223</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">extend</span><span class="PUNC">(</span><span class="NAME">jindo.Component</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>224</span> 
<span class='line'>225</span> </span><span class="NAME">nhn.newsstand.myscrap.FolderMoveDrag.oHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">	</span><span class="NAME">DRAGGING_FOLDER</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">		</span><span class="PUNC">[</span><span class="STRN">'&lt;span class="{if level===1}{if hasChild}opn{else}no{/if} {else}child{/if}">'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">		 </span><span class="STRN">'{=folderNm}'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">		 </span><span class="STRN">'&lt;/span>'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">	    </span><span class="STRN">'&lt;div class="shadow">&lt;/div>'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">""</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>231</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>